package com.shebao.utils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

/**
 * 定时任务，每天清除生成的pdf文件
 * @author duanran
 *
 */
@Component
@EnableScheduling
public class QuartzUtil {
	
	@Autowired
	private FileUtil fileUtil;
	
	@Scheduled(cron = "0 0 12 * * ?") // 每天12点执行一次
	public void cleanPDF(){
		fileUtil.cleanFile();
	}
}
